from typing import List

from example.core.model.sys_user_model import SysUserBaseModel
from example.globals.db import async_database_helper


class SysUserCRUD:
    @staticmethod
    async def select_all() -> list[SysUserBaseModel]:
        query = "select * from sys_user"
        users = await async_database_helper.fetch_all(query)
        return [SysUserBaseModel(**user) for user in users]
